﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace MDCAdminTool.Controls
{
    
    public partial class NewCacheNameWin : Window
    {
        public string CacheName { get; set; }
        public bool IsHighAvailability { get; set; }
        public bool NotificationsEnabled { get; set; }
        public Eviction Eviction { get; set; }
        public Int64 TTL { get; set; }
        public bool IsExpirable { get; set; }
		public bool IsReady { get; private set; }

        public NewCacheNameWin()
        {
            InitializeComponent();
        }

        private void Newbtn_Click( object sender , RoutedEventArgs e )
        {
            try
            {
                CacheName          = tbName.Text;
                IsHighAvailability = (bool)tbIsHighAvailability.SelectedItem;
                TTL                = Convert.ToInt64( tbTTL.Text );
                IsExpirable       = (bool)tbIsExpirable.SelectedItem;
                Eviction           = (Eviction)tbEviction.SelectedItem;
                NotificationsEnabled = (bool)tbNotificationsEnabled.SelectedItem;
            	IsReady = true;
            }
            catch {}


            this.Hide();
        }
    }
}
